import { createRouter, createWebHistory } from 'vue-router'
import DiaryView from '../views/DiaryView.vue'
import HomeView from '../views/HomeView.vue'
import NoteView from '../views/NoteView.vue'
import ShareView from '../views/ShareView.vue'
import InfoView from '../views/InfoView.vue'
import WriteView from '../views/WriteView.vue'
import DetialView from '../views/DetialView.vue'
import SettingView from '../views/SettingView.vue'
import LoginView from '../views/LoginView.vue'
import PairView from '../views/PairView.vue'








const routes = [
  {
    path: '/',
    redirect: '/home/diary',
  },
  {
    path:'/home',
    component: HomeView,
    redirect: '/home/diary',
    children:[
    {
      name:'diary',
      path:'diary',
      component: DiaryView,
    },
    {
      name:'note',
      path:'note',
      component: NoteView
    },{
      name:'share',
      path:'share',
      component: ShareView
    },{
      name:'info',
      path:'info',
      component: InfoView
    },
  ]
  },
  {
    path:'/write',
    component: WriteView
  },
  {
    path:'/detial',
    name: "detial",
    component: DetialView
  },
  {
    path:'/setting',
    name: "setting",
    component: SettingView
  },
  {
    path:'/login',
    name: "login",
    component: LoginView
  },
  {
    path:'/pair',
    name: "pair",
    component: PairView
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router





// {
//   path: '/about',
//   name: 'about',
//   // route level code-splitting
//   // this generates a separate chunk (about.[hash].js) for this route
//   // which is lazy-loaded when the route is visited.
//   component: function () {
//     return import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
//   }
// }